package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.UserResourcesCopyMapper;
import com.education.wisdom.pojo.UserResourcesCopy;
import com.education.wisdom.service.IUserResourcesCopyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 教你赚资源的资源 服务层实现
 *
 * @author ruoyi
 * @date 2019-07-04
 */
@Service
public class UserResourcesCopyServiceImpl implements IUserResourcesCopyService {
    @Autowired
    private UserResourcesCopyMapper userResourcesCopyMapper;

    /**
     * 查询教你赚资源的资源信息
     *
     * @param id 教你赚资源的资源ID
     * @return 教你赚资源的资源信息
     */
    @Override
    public UserResourcesCopy selectUserResourcesCopyById(Integer id) {
        return userResourcesCopyMapper.selectUserResourcesCopyById(id);
    }

    /**
     * 查询教你赚资源的资源列表
     *
     * @param userResourcesCopy 教你赚资源的资源信息
     * @return 教你赚资源的资源集合
     */
    @Override
    public List<UserResourcesCopy> selectUserResourcesCopyList(UserResourcesCopy userResourcesCopy) {
        return userResourcesCopyMapper.selectUserResourcesCopyList(userResourcesCopy);
    }

    /**
     * 新增教你赚资源的资源
     *
     * @param userResourcesCopy 教你赚资源的资源信息
     * @return 结果
     */
    @Override
    public int insertUserResourcesCopy(UserResourcesCopy userResourcesCopy) {
        return userResourcesCopyMapper.insertUserResourcesCopy(userResourcesCopy);
    }

    /**
     * 修改教你赚资源的资源
     *
     * @param userResourcesCopy 教你赚资源的资源信息
     * @return 结果
     */
    @Override
    public int updateUserResourcesCopy(UserResourcesCopy userResourcesCopy) {
        return userResourcesCopyMapper.updateUserResourcesCopy(userResourcesCopy);
    }

    /**
     * 删除教你赚资源的资源对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteUserResourcesCopyByIds(String ids) {
        return userResourcesCopyMapper.deleteUserResourcesCopyByIds(Convert.toStrArray(ids));
    }

    @Override
    public List<UserResourcesCopy> selectByCatalogId(Integer catalogId) {
        return userResourcesCopyMapper.selectByCatalogId(catalogId);
    }

    @Override
    public List<UserResourcesCopy> selectByNewTime(Integer count) {
        return userResourcesCopyMapper.selectByNewTime(count);
    }

    @Override
    public List<UserResourcesCopy> selectByPay(String userId) {
        return userResourcesCopyMapper.selectByPay(userId);
    }

    @Override
    public List<UserResourcesCopy> selectByUserId(String userId) {
        return userResourcesCopyMapper.selectByUserId(userId);
    }

}
